package com.iknow.activity;

import android.app.TabActivity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import com.iknow.IKnow;
import com.iknow.util.MsgDialog;

public class MenuActivity extends TabActivity
{
  private MenuItem.OnMenuItemClickListener AboutClickListener;
  private MenuItem.OnMenuItemClickListener ExitClickListener;
  private MenuItem.OnMenuItemClickListener FeedbackClickListener;

  public MenuActivity()
  {
    this.FeedbackClickListener = new MenuItem.OnMenuItemClickListener(this)
    {
      public boolean onMenuItemClick()
      {
        Intent localIntent = new Intent(this.this$0, FeedbackActivity.class);
        this.this$0.startActivity(localIntent);
        return false;
      }
    };
    this.AboutClickListener = new MenuItem.OnMenuItemClickListener(this)
    {
      public boolean onMenuItemClick()
      {
        Intent localIntent = new Intent(this.this$0, AboutActivity.class);
        this.this$0.startActivity(localIntent);
        return false;
      }
    };
    this.ExitClickListener = new MenuItem.OnMenuItemClickListener(this)
    {
      public boolean onMenuItemClick()
      {
        MsgDialog.showB2Dilog(this.this$0, 2131361808, new DialogInterface.OnClickListener(this)
        {
          public void onClick(, int paramInt)
          {
            switch (paramInt)
            {
            default:
            case -1:
            }
            while (true)
            {
              return;
              MenuActivity.3.access$0(this.this$1).finish();
            }
          }
        });
        return false;
      }
    };
  }

  public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  {
    boolean bool;
    if ((paramKeyEvent.getAction() == 0) && (paramKeyEvent.getKeyCode() == 4))
    {
      MsgDialog.showB2Dilog(this, 2131361808, new DialogInterface.OnClickListener(this)
      {
        public void onClick(, int paramInt)
        {
          switch (paramInt)
          {
          default:
          case -1:
          }
          while (true)
          {
            return;
            this.this$0.finish();
          }
        }
      });
      bool = true;
    }
    while (true)
    {
      while (true)
      {
        return bool;
        if (paramKeyEvent.getKeyCode() != 84)
          break;
        bool = super.onSearchRequested();
      }
      bool = super.dispatchKeyEvent(paramKeyEvent);
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    IKnow.setLight(getParent());
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    getMenuInflater().inflate(2131492864, paramMenu);
    MenuItem localMenuItem1 = paramMenu.getItem(0);
    localMenuItem1.setIcon(2130837676);
    localMenuItem1.setOnMenuItemClickListener(this.FeedbackClickListener);
    MenuItem localMenuItem2 = paramMenu.getItem(1);
    localMenuItem2.setIcon(2130837675);
    localMenuItem2.setOnMenuItemClickListener(this.AboutClickListener);
    MenuItem localMenuItem3 = paramMenu.getItem(2);
    localMenuItem3.setIcon(2130837678);
    localMenuItem3.setOnMenuItemClickListener(this.ExitClickListener);
    return super.onCreateOptionsMenu(paramMenu);
  }

  protected void onResume()
  {
    super.onResume();
    IKnow.setLight(getParent());
  }
}